$(function(){
	
	//判断是否为手机号
	window.mobile = function( field, rules, i, options ){
		var thisValue = field[0].value;
		var reg = /^1\d{10}$/;
		if(!reg.test(thisValue)){
			var message = "请输入正确的手机号！"
			return message;
		}
		
	}
	
	//判断是否为邮箱
	window.email = function( field, rules, i, options ){
		var thisValue = field[0].value;
		var reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
		if(!reg.test(thisValue)){
			var message = "请输入正确的邮箱账号！"
			return message;
		}
		
	}
	
	//判断是否为四位以内的正整数
	window.isInt4 = function( field, rules, i, options ){
		var thisValue = field[0].value;
		var reg = /^[1-9]\d{0,3}$/;
		if(!reg.test(thisValue)){
			var message = "请输入四位以内的正整数！"
			return message;
		}
		
	}
	
});